<?php


namespace app\shop\validate;

use think\Validate;

/**
 * 订单验证器
 * Class Order
 * @package app\Goods\validate
 * @author Mr.Li
 * @create 2021-05-26 14:23
 */
class Order extends Validate
{

    /**
     * 验证规则
     * @var string[]
     */
    protected $rule = [
        'sale_id'          => 'require',
        'uid'              => 'require',
        'consignee'        => 'require',
        'goodsList'        => 'require',
        'business_type'    => 'require',
        'order_type'       => 'require',
        'deal_time'       => 'require'
    ];

    /**
     * 错误信息
     * @var string[]
     */
    protected $message = [
        'sale_id.require'       => '护理师（开单人）必须选择',
        'uid.require'           => '下单客户必须选择',
        'consignee.require'     => '联系人不能为空',
        'goodsList.require'     => '请添加商品',
        'business_type.require' => '业务类型必须选择',
        'order_type.require'    => '订单类型必须选择',
        'deal_time.require'    => '成交日期必须选择'
    ];


    protected $scene = [
        'create'       => ['sale_id','uid','consignee','goodsList','business_type']
    ];
}
